<template>
	<view class="info">
		<view class="item">
			<view class="title_item">
				<view class="title">{{StudentRecordingData.pcName}}</view>
				<!-- <view class="con"></view> -->
				<!-- <view class="def">审核中</view> -->
				<view v-if="StudentRecordingData.status==1" class="yesdef">审核通过</view>
				<!-- <view  class="yesdef">审核通过</view> -->
				<view v-else-if="StudentRecordingData.status==2" class="nodef">审核未通过</view>
				<!-- <view class="nodef">审核未通过</view> -->
				<view v-else-if="StudentRecordingData.status==3" class="nodef">已撤销</view>
				<!-- <view  class="nodef">已撤销</view> -->
				<view v-else class="def">审核中</view>
			</view>
			<view class="gw_item_zx">
				<image class="ico" src="../../../static/img/qq.png"></image>
				<view>QQ</view>
				<view>{{StudentRecordingData.linkTel}}</view>
			</view>
			<view class="gw_item_zx">
				<image class="ico" src="../../../static/img/email.png"></image>
				<view>邮箱</view>
				<view>{{StudentRecordingData.email}}</view>
			</view>
			<!-- <view v-if="StudentRecordingData.status!==3" class="title_item"> -->
			<view class="title_item">
				<view class="_null"></view>

				<view v-if="StudentRecordingData.status==1" class="nodef1">(如需撤销请自行联系教师/企业进行沟通)</view>
				<!-- <view  class="nodef1">(如需撤销请自行联系教师/企业进行沟通)</view> -->
				<view v-else-if="StudentRecordingData.status==2" class="nodef1">(请重新选择项目班进行报名)</view>
				<!-- <view  class="nodef1">(请重新选择项目班进行报名)</view> -->
				<view v-else-if="StudentRecordingData.status==0" class="nodef2" @click="undo">撤销</view>
				<!-- <view class="nodef1">撤销</view> -->
			</view>
		</view>

		<uni-popup ref="popupBM" type="dialog">
			<!-- title="通知1" -->
			<uni-popup-dialog type="success" :content="message" :before-close="true" @confirm="dialogConfirm" @close="dialogClose">
			</uni-popup-dialog>
		</uni-popup>
	</view>
</template>

<script>
	import uniPopupMessage from '@/components/uni-popup/uni-popup-message.vue'
	import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
	import uniPopupShare from '@/components/uni-popup/uni-popup-share.vue'

	import {
		// getTest,
		undo
	} from '@/api/status/service.js';

	export default {
		props: {
			StudentRecordingData: Object
		},
		data() {
			return {
				message: "确定撤销?"
			}
		},
		components: {
			uniPopupMessage,
			uniPopupDialog,
			uniPopupShare
		},
		methods: {
			undo() {
				this.$refs.popupBM.open();
			},
			dialogConfirm(done) {
				console.log('确定撤销');
				this.StudentRecordingData.status = 3;
				console.log(this.StudentRecordingData.stuId, this.StudentRecordingData.pId, this.StudentRecordingData.pcId);
				undo(this.StudentRecordingData.stuId, this.StudentRecordingData.pId, this.StudentRecordingData.pcId)
					.then(res => {
						console.log(res)
					}).catch(res => {
						console.log(res)
					})
				// 需要执行 done 才能关闭对话框
				done()
				this.$forceUpdate();
				console.log("---------------------", this.StudentRecordingData)
			},
			dialogClose(done) {
				console.log('取消撤销');
				// 需要执行 done 才能关闭对话框
				done()
			}
		}
	}
</script>

<style>
	.info {
		margin: 30rpx;
	}


	.item {
		margin: 20rpx 5rpx;
	}

	.gw_item_zx {
		margin: 20rpx 20rpx 10rpx 0rpx;
		font-size: 32rpx;
		display: flex;
		align-items: center;
		opacity: 0.8;
		flex: 1;
	}

	.gw_item_zx view {
		margin-left: 14rpx;
	}

	.ico {
		width: 30rpx;
		height: 35rpx;
	}

	.title {
		flex: 4;
		/* font-weight: 7; */
		color: #000000;
		font-size: 36rpx;
		font-weight: 700;
		opacity: 0.9;
	}

	.def {
		flex: 1;
		/* font-weight: 7; */
		color: rgba(53, 197, 82, 1);
		font-size: 30rpx;
		font-weight: 700;
		opacity: 0.9;
		align-items: flex-end;
		text-align: end;
	}

	.nodef {
		flex: 1;
		/* font-weight: 7; */
		color: rgba(78, 78, 78, 0.8);
		font-size: 28rpx;
		font-weight: 700;
		opacity: 0.9;
		align-items: flex-end;
		text-align: end;
	}

	._null {
		flex: auto;
	}

	.nodef1 {

		/* font-weight: 7; */
		color: rgba(78, 78, 78, 0.8);
		font-size: 25rpx;
		font-weight: 700;
		/* width: 100rpx; */
		/* border: 5px solid red; */
		opacity: 0.9;
		align-items: flex-end;
		text-align: end;
	}

	.nodef2 {

		/* font-weight: 7; */
		color: rgba(78, 78, 78, 0.8);
		font-size: 25rpx;
		font-weight: 700;
		/* width: 100rpx; */
		padding: 5rpx 10rpx;
		border: 1px solid rgba(78, 78, 78, 1);
		border-radius: 6px;
		opacity: 0.9;
		align-items: flex-end;
		text-align: center;

	}

	.yesdef {
		flex: 1;
		/* font-weight: 7; */
		color: rgba(53, 197, 82, 1);
		font-size: 30rpx;
		font-weight: 700;
		opacity: 0.9;
		align-items: flex-end;
		text-align: end;
	}

	.con {
		flex: 1;
	}

	.title_item {
		align-items: center;
		display: flex;
	}
</style>
